﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GiaPhuc.Data;
using System.Data;

namespace GiaPhuc.Controls
{
    public partial class RightLayout : System.Web.UI.UserControl
    {

        public IList<EZPages> EZPages
        {
            get { return Session["Pages"] as IList<EZPages>; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                using (IDbConnection connection = new MySql.Data.MySqlClient.MySqlConnection(Helper.ConnectionString))
                {
                    using (ResellEraDMInPhUkIeNipAdX context = new ResellEraDMInPhUkIeNipAdX(connection))
                    {
                        Session["Pages"] = context.EZPages.Where(x => x.ToCChapter == (int)PageType.Topic).ToList();
                    }
                }
            }
        }
    }
}